<template>
  <div class="right">
    <!-- 类型数据type,1 -->
    <div class="item_list _item1 warpper_box">
      <div class="article_title">{{bind}}</div>
      <div class="article_main" v-for="(item) in hotel_list" :key='item.id'>
        <div class="left">
          <img :src='item.image' alt />
        </div>
        <div class="right">
          <div class="main_body">{{item.title}}</div>
          <div>{{item.introduce}}</div>
          <div>地址:  {{item.address}}</div>
          <div class="giveLike">
            <p>
              <span>{{item.score}}</span>
              <span>{{item.comment}}</span>
              <span>{{item.price}}</span>
            </p>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
import { post } from "@/plugins/api";
export default {
  data() {
    return {
      bind: "",
      city: "",
      hotel_list:[]
    };
  },
  methods: {
    get_data_list() {
      post("/hotel/select_hotel", { city: this.city, bind: this.bind }).then(
        res => {
          this.hotel_list = res.data
        }
      );
    }
  },
  mounted() {
    let { bind, city } = this.$route.query;
    if (bind && city) {
      this.bind = bind;
      this.city = city;
      this.get_data_list();
    } else {
      this.$router.repeat("/hotel");
    }
  }
};
</script>
<style lang="scss" scoped>
.right {
  h2.title {
    font-weight: 400;
    font-size: 30px;
    border-bottom: 1px solid #ddd;
  }
  .item_list {
    // border-bottom: 1px solid #ddd;
    padding: 20px 0 60px;
    &._item1 {
      .from_box {
        display: flex;
        justify-content: space-between;
        align-items: center;
      }
      .article_title {
        font-size: 24px;
      }
      .article_main {
        display: flex;
        // justify-content: space-between;
        margin-top:40px;
        border-bottom: 1px solid #ddd;
        .left {
          margin-right: 20px;
          width: 200px;
          img {
            width: 100%;
          }
        }
        .right {
          width:40%;
          // .main_body {
          // }
          .giveLike {
            text-align: right;
            font-size: 12px;
            p {
              color: #ff9d00;
              margin-top:60px;
              span {
                color: #000;
                margin: 0 10px;
              }
            }
          }
        }
      }
    }
  }
}
</style>
